/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.cip.esymons.colegiatura.be;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author ADMINISTRADOR
 */
@Entity
@Table(name = "col_institucion_academica")
//@NamedQueries({@NamedQuery(name = "InstitucionAcademica.findAll", query = "SELECT i FROM InstitucionAcademica i"), @NamedQuery(name = "InstitucionAcademica.findByIacCodigo", query = "SELECT i FROM InstitucionAcademica i WHERE i.iacCodigo = :iacCodigo"), @NamedQuery(name = "InstitucionAcademica.findByIacDescripcion", query = "SELECT i FROM InstitucionAcademica i WHERE i.iacDescripcion = :iacDescripcion")})
public class InstitucionAcademica implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "iac_codigo")
    private Integer iacCodigo;
    @Basic(optional = false)
    @Column(name = "iac_descripcion")
    private String iacDescripcion;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "instAcademica", fetch = FetchType.LAZY)
    private List<EstudioColegiado> estudioColegiadoCollection;

    public InstitucionAcademica() {
    }

    public InstitucionAcademica(Integer iacCodigo) {
        this.iacCodigo = iacCodigo;
    }

    public InstitucionAcademica(Integer iacCodigo, String iacDescripcion) {
        this.iacCodigo = iacCodigo;
        this.iacDescripcion = iacDescripcion;
    }

    public Integer getIacCodigo() {
        return iacCodigo;
    }

    public void setIacCodigo(Integer iacCodigo) {
        this.iacCodigo = iacCodigo;
    }

    public String getIacDescripcion() {
        return iacDescripcion;
    }

    public void setIacDescripcion(String iacDescripcion) {
        this.iacDescripcion = iacDescripcion;
    }

    public List<EstudioColegiado> getEstudioColegiadoCollection() {
        return estudioColegiadoCollection;
    }

    public void setEstudioColegiadoCollection(List<EstudioColegiado> estudioColegiadoCollection) {
        this.estudioColegiadoCollection = estudioColegiadoCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (iacCodigo != null ? iacCodigo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof InstitucionAcademica)) {
            return false;
        }
        InstitucionAcademica other = (InstitucionAcademica) object;
        if ((this.iacCodigo == null && other.iacCodigo != null) || (this.iacCodigo != null && !this.iacCodigo.equals(other.iacCodigo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.cip.esymons.colegiatura.be.InstitucionAcademica[iacCodigo=" + iacCodigo + "]";
    }

}
